import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Login',
        redirect: "/login"
    },
    {
        path: "/login",
        name: "Login",
        component: Login
    },
    {
        path: '/main',
        name: 'main',
        component: () => import(/* 登录 */ '../views/Main.vue'),
        children: [
            // doctor模块
            {
                path: '/doctor/registered',
                name: 'registered',
                component: () => import(/* 门诊挂号 */ '../views/doctor/Registered.vue')
            },
            {
                path: '/doctor/registeredlist',
                name: 'registeredlist',
                component: () => import(/* 挂号列表 */ '../views/doctor/RegisteredList.vue')
            },
            {
                path: '/doctor/newcare',
                name: 'newcare',
                component: () => import(/* 新开就诊 */ '../views/doctor/NewCare.vue')
            },
            {
                path: '/doctor/myscheduling',
                name: 'myscheduling',
                component: () => import(/* 我的排班 */ '../views/doctor/MyScheduling.vue')
            },
            {
                path: '/doctor/scheduling',
                name: 'scheduling',
                component: () => import(/* 医生排班 */ '../views/doctor/Scheduling.vue')
            },
            {
                path: '/doctor/patient',
                name: 'patient',
                component: () => import(/* 患者库 */ '../views/doctor/Patient.vue')
            },

            // system模块
            {
                path: '/system/user',
                component: () => import("../views/system/User")
            },
            {
                path: '/system/menu',
                component: () => import("../views/system/Menu")
            },
            {
                path: '/system/role',
                component: () => import("../views/system/Role")
            },
            {
                path: '/system/dict',
                component: () => import("../views/system/DictType")
            },
            {
                path: '/system/dept',
                component: () => import("../views/system/Dept")
            },
            {
                path: '/system/log_opt',
                component: () => import("../views/system/OperLog")
            },
            {
                path: '/system/log_login',
                component: () => import("../views/system/LoginLog")
            },
            {
                path: '/system/ins_fee',
                component: () => import("../views/system/Examine")
            },
            {
                path: '/system/reg_fee',
                component: () => import("../views/system/Registered")
            },
            {
                path: '/system/notice',
                component: () => import("../views/system/Notice")
            },
            // {
            //   path: '/system/indexdept',
            //     component: () => import("../views/system/indexdept")
            // },

            // charge 模块
            {
                path: '/charge/backfee',
                component: () => import("../views/charge/backfee")
            }
            ,
            {
                path: '/charge/backfeelist',
                component: () => import("../views/charge/backfeelist")
            }
            ,
            {
                path: '/charge/chargelist',
                component: () => import("../views/charge/chargelist")
            }
            ,
            {
                path: '/charge/dispensing',
                component: () => import("../views/charge/dispensing")
            },
            {
                path: '/charge/docharge',
                component: () => import("../views/charge/docharge")
            },

            // stock 模块
            {
                path:"/stock/examine",
                component:()=>import("../views/stock/examine")
            },
            {
                path:"/stock/inventory",
                component:()=>import("../views/stock/inventory")
            },
            {
                path:"/stock/medicinal",
                component:()=>import("../views/stock/medicinal")
            },
            {
                path:"/stock/producter",
                component:()=>import("../views/stock/producter")
            },
            {
                path:"/stock/provider",
                component:()=>import("../views/stock/provider")
            },
            {
                path:"/stock/purchase",
                component:()=>import("../views/stock/purchase")
            },
            {
                path:"/stock/newPurchase",
                name: 'newPurchase',
                component:()=>import("../views/stock/newPurchase"),
            },
            {
                path:"/stock/editPurchase/:purchaseId",
                name:'editPurchase',
                component:()=>import("../views/stock/editPurchase")
            },


            //check
            {
                path:"/check/checklist",
                component:()=>import("../views/check/checklist")
            },
            {
                path:"/check/checkresult",
                component:()=>import("../views/check/checkresult"),
            },
            {
                path:"/check/docheck",
                component:()=>import("../views/check/docheck")
            },

            // statistics
            {
                path: '/statistics/check',
                component: () => import("../views/statistics/check")
            }
            ,
            {
                path: '/statistics/revenue',
                component: () => import("../views/statistics/revenue")
            }
            ,
            {
                path: '/statistics/sales',
                component: () => import("../views/statistics/sales")
            }
            ,
            {
                path: '/statistics/workload',
                component: () => import("../views/statistics/workload")
            },
            {
                path: '/statistics/components/PieChart',
                component: () => import("../views/statistics/components/PieChart")
            },

        ]
    },
    {
        path: '/pre_factory',
        name: 'pre_factory',
        component: () => import(/* 生产厂家维护 */ '../views/drug_jxc/preservation_factory.vue')
    },
]

const router = new VueRouter({
    routes
})

export default router
